#include <iostream>
#include<vector>
#include<algorithm>
using namespace std;

int main() {
    int n = 0;
    cin >> n;
    vector<int> v(3 * n, 0);
    for (int i = 0; i < 3 * n; i++) cin >> v[i];
    //cout<<"??"<<endl;
    long long ret = 0;
    sort(v.begin(), v.end());
    int pos = v.size() - 2;
    while (n)
    {
        ret += v[pos];
        pos -= 2;
        n--;



    }
    cout << ret;


}